<?php

namespace app\_test;

use think\Controller;

class _getSession extends Controller
{
    public function v_1_0($args)
    {

        $response = []; // 定义返回数组

        // 一、判断传入参数
        // ------------------------------------------------------------------------------
        if (!isset($args['key']) || !$args['key']) {
            return [
                '_err_num' => 11,
                '_err_msg' => 'input args error',
                '_err_ext' => '缺少参数(key)',
            ];
        }


        // 二、逻辑处理
        // ------------------------------------------------------------------------------
        $response['value'] = session($args['key']);


        // 三、执行与返回
        // ------------------------------------------------------------------------------
        $response['time'] = DATE_TIME;
        return $response;
    }
}
